﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 单元测试_使用Mock
{
    class Checker
    {
        private IEnvironment _environment;

        public Checker(IEnvironment environment)
        {
            _environment = environment;
        }

        public void Alarm()
        {
            if(_environment.Now.Hour >= 12)
            {
                Console.WriteLine("时间到！");
                _environment.PlaySound();
            }
            else
            {
                Console.WriteLine("时间还没到~");
            }
        }
    }
}
